<?php
namespace Controller\Admin;
class ProductsController{
    // use jump;
    // 获取商品列表
    public function listAction(){
         // 实例化模型
        $model=new \Model\ProductsModel();
        $data=$model->getList();
        require './products_list.html';
        
    }    
    public function addAction(){
        echo '添加';
    }
    public function delAction(){
        $id=(int)$_GET['proid'];//如果参数明显是整数要强制转为整形
        $model=new ProductsModel();
        $model->del($id);
        if($model->del($id)){
            header('location:index.php?c=Products&a=list');
            // $this->redirect('index.php?c=Products&a=list','删除成功','2','success');
        }else{
            echo "删除失败";
              // $this->redirect('index.php?c=Products&a=list','删除失败','2','success');
            exit;
        }
            
    }
}
?>